import { axios } from '../utils/http'

/**
 * @description 获取主页榜单数据
 * @param {Number} id 歌单id
 * @param {Number} timestamp 时间戳防止缓存
 */
export const playList = id => {
  const params = {
    id: id,
    timestamp: new Date().getTime()
  }
  return axios.get('/playlist/detail', { params })
}

/**
 * @description 获取榜单列表简介
 */
export const allToplist = () => {
  return axios.get('/toplist')
}

/**
 * @description 获取歌单分类
 */
export const catlist = () => {
  return axios.get('/playlist/catlist')
}

/**
 * @description 获取歌单列表
 * @param { Object } params -对象参数 { order: 'hot', cat: '全部', limit: 35, offset: 0 }
 */
export const topPlayList = (params) => {
  return axios.get('/top/playlist', { params})
}